<?php
include_once('global.php');
$action = _('_act');
VerificationCode::$rand_string = "ABCDEFGHJKMNPQRSTUVWXYZ23456789";
switch($action){
	case 'gen':
		header("P3P: CP=CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR");
		$value = VerificationCode::randomVcode();
		vcode_set2($value, Cache::getInstance(), 'vcode', 300);
		if($value!=false){
			$vcode = new VerificationCode($value, 26);
			$vcode->draw(true, false, false);
			$vcode->output();
		}
	break;	
	case 'test':
		echo vcode_get2(Cache::getInstance(), 'vcode');
	break;
}
?>